/** 
* Copyright (C) 2012-2018 ZEEI Inc.All Rights Reserved.
* 项目名称：pls
* 文件名称：PunishInfoGisController.java
* 包  名  称：com.zeei.gis.controller
* 文件描述：TODO 请修改文件描述
* 创建日期：2018年1月19日下午1:37:53
* 
* 修改历史
* 1.0 jiangqingpeng 2018年1月19日下午1:37:53 创建文件
*
*/

package com.zeei.gis.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zeei.common.annotation.SysLog;
import com.zeei.common.controller.BasicController;
import com.zeei.common.enums.LogType;
import com.zeei.common.vo.ResultDataVO;
import com.zeei.common.vo.ResultRowsVO;
import com.zeei.gis.service.PunishInfoGisService;
import com.zeei.gis.vo.PunishInfoConditionGisVO;
import com.zeei.gis.vo.PunishInfoGisVO;

/**
 * @类型名称：PunishInfoGisController
 * @类描述：TODO 违法企业管理
 * @功能描述：TODO 违法企业管理
 * @创建作者：jiangqingpeng
 */

@Controller
@RequestMapping("/gis/punishinfo")
public class PunishInfoGisController extends BasicController{

	@Autowired
	PunishInfoGisService punishInfoGisService;
	
	@RequestMapping(value="/list")
	@ResponseBody
	@SysLog(text="按年份统计每个市和区县企业次数",type=LogType.View)
	public ResultRowsVO<PunishInfoGisVO> queryPunishInfoByYear(PunishInfoConditionGisVO punishInfoConditionGisVO) {
		List<PunishInfoGisVO> listData = punishInfoGisService.queryPunishInfoByYear(punishInfoConditionGisVO);
		return this.createResultRowsVO(listData, true, "", listData.size());
	}
	
	@RequestMapping(value="/companys", method=RequestMethod.POST)
	@ResponseBody
	@SysLog(text="查询每个区县下每个企业是否违法", type=LogType.View)
	public ResultRowsVO<PunishInfoGisVO> queryCompanyPunishInfo(PunishInfoConditionGisVO punishInfoConditionGisVO){
		List<PunishInfoGisVO> listData = punishInfoGisService.queryCompanyPunishInfo(punishInfoConditionGisVO);
		return this.createResultRowsVO(listData, true, "", listData.size());
	}
	
	@RequestMapping(value="/ranking", method=RequestMethod.POST)
	@ResponseBody
	@SysLog(text="查询企业违法排名，违法次数最多的排在最前面", type=LogType.View)
	public ResultDataVO<Map<String, Object>> queryCompanyPunishRanking(PunishInfoConditionGisVO punishInfoConditionGisVO) {
		Map<String, Object> map = punishInfoGisService.queryCompanyPunishRanking(punishInfoConditionGisVO);
		return this.createResultDataVO(map, true, "");
	}
	
	@RequestMapping(value="/record", method=RequestMethod.POST)
	@ResponseBody
	@SysLog(text="通过企业id查询企业违法记录", type=LogType.View)
	public ResultRowsVO<PunishInfoGisVO> queryPunishInfoByPscode(PunishInfoConditionGisVO punishInfoConditionGisVO) {
		List<PunishInfoGisVO> listData = punishInfoGisService.queryPunishInfoByPscode(punishInfoConditionGisVO);
		return this.createResultRowsVO(listData, true, "", listData.size());
	}
}
